<form name="frmlist" id="frmlist" action="<?php echo $this->site['base_url']?>admin_customer/search" method="post" >
<table cellspacing="0" cellpadding="0" class="title">
  <tr>
    <td class="title_label"><?php echo Kohana::lang('customer_lang.tt_page') ?></td>
    <td class="title_button">
    <button type="button" name="btn_new" class="button new" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_customer/create'"/>
    <span><?php echo Kohana::lang('customer_lang.btn_new_customer') ?></span>
    </button>
    </td>
  </tr>
</table>
<table cellspacing="0" class="list_top">
  <tr>
    <td><?php echo Kohana::lang('admin_lang.lbl_search') ?>:
      <input name="txt_keyword" type="text" id="txt_keyword" value="<?php if(isset($keyword)) echo $keyword ?>"  />
      &nbsp;
      <button type="submit" name="btn_search" class="button search" />
      <span><?php echo Kohana::lang('admin_lang.lbl_search') ?></span>
      </button>
      </td>
  </tr>
</table>
<table cellspacing="1" cellpadding="5" class="list">
  <tr class="list_header">
    <td width="10"><input type="checkbox" name="checkbox" value="checkbox" onclick='checkedAll(this.checked);' ></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_username') ?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_email') ?></td>
     <td><?php echo Kohana::lang('customer_lang.lbl_type') ?></td>
    <td width="80" align="center"><?php echo Kohana::lang('admin_lang.lbl_status') ?></td>
    <td width="80" align="center"><?php echo Kohana::lang('admin_lang.lbl_action') ?></td>
  </tr>
  <?php for($i=0; $i<count($mlist); $i++){ ?>
  <tr class="row<?php if($i%2 == 0) echo 2 ?>">
    <td><input name="chk_id[]" type="checkbox" id="chk_id[]" value="<?php echo $mlist[$i]['customers_id'] ?>"></td>
    <td><a href="<?php echo $this->site['base_url']?>admin_customer/edit/<?php echo $mlist[$i]['customers_id'] ?>"><?php echo $mlist[$i]['customers_username'] ?></a></td>
     <td><a href="<?php echo $this->site['base_url']?>admin_customer/edit/<?php echo $mlist[$i]['customers_id'] ?>"><?php echo $mlist[$i]['customers_email'] ?></a></td>
    <td align="center"><a href="<?php echo $this->site['base_url']?>admin_customer/edit/<?php echo $mlist[$i]['customers_id'] ?>"><?php if($mlist[$i]['customers_type'] == 1){ echo Kohana::lang('customer_lang.lbl_wholesaler');} else {echo Kohana::lang('customer_lang.lbl_customer');} ?></a></td>
    <td align="center">
    <?php if($mlist[$i]['customers_status'] == 1){ ?>
	<a href="<?php echo $this->site['base_url']?>admin_customer/setstatus/<?php echo $mlist[$i]['customers_id'] ?>/0" >
	<img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_active.png" title="<?php echo Kohana::lang('admin_lang.lbl_active') ?>" />
    </a>
	<?php } else { ?>
	<a href="<?php echo $this->site['base_url']?>admin_customer/setstatus/<?php echo $mlist[$i]['customers_id'] ?>/1" >
	<img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_inactive.png" title="<?php echo Kohana::lang('admin_lang.lbl_inactive') ?>" />
    </a>
	<?php } ?>
    </td>
    <td align="center">
    <a href="<?php echo $this->site['base_url']?>admin_order/search/cus/<?php echo $mlist[$i]['customers_id'] ?>">
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_list.png" title="<?php echo Kohana::lang('customer_lang.lbl_invoice_list') ?>" />
    </a>
    <a href="<?php echo $this->site['base_url']?>admin_customer/send_price_list/<?php echo $mlist[$i]['customers_id'] ?>">
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_price_list.png" title="<?php echo Kohana::lang('customer_lang.lbl_price_list') ?>" />
    </a>
    <a href="<?php echo $this->site['base_url']?>admin_customer/edit/<?php echo $mlist[$i]['customers_id'] ?>">
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_edit.png" title="<?php echo Kohana::lang('admin_lang.btn_edit') ?>" />
    </a>
    <a href="<?php echo $this->site['base_url']?>admin_customer/delete/<?php echo $mlist[$i]['customers_id'] ?>" onclick="return confirm('<?php echo Kohana::lang('errormsg_lang.msg_confirm_del'); ?>')" >	
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_delete.png" title="<?php echo Kohana::lang('admin_lang.btn_delete') ?>" />
    </a>    
    </td>
  </tr>
  <?php } ?>
</table>
<table cellspacing="0" cellpadding="5"  class="list_bottom"  >
  <tr>
    <td><select name="sel_action" id="sel_action">
        <option value="block"><?php echo Kohana::lang('admin_lang.lbl_block_selected') ?></option>
        <option value="active"><?php echo Kohana::lang('admin_lang.lbl_active_selected') ?></option>
        <option value="delete"><?php echo Kohana::lang('admin_lang.lbl_delete_selected') ?></option>
      </select>
      &nbsp;
      <button type="button" name="btn_update" class="button save" onclick="sm_frm(frmlist,'<?php echo $this->site['base_url']?>admin_customer/saveall','<?php echo Kohana::lang('errormsg_lang.msg_confirm_del') ?>');"/>
      <span><?php echo Kohana::lang('admin_lang.btn_update') ?></span>
      </button>
      </td>
  </tr>
</table>
<div class='pagination'><?php echo $this->pagination?></div>
</form>